<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.15.9/theme-chalk/index.css">
    <style>
        header a{
            text-decoration: none;
            color: #6c6c6c;
            font-size: x-small;
        }
    </style>
</head>
<body>
<div id="app">
    <el-container>
        <el-header height="150p">
            <div style="width: 1200px;margin: 0 auto">
                <img src="img/1.png" style="width: 200px;vertical-align: middle" alt="">
                <span>
                    <a href="">首页</a><el-divider direction="vertical"></el-divider>
                    <a href="">校区汇总</a><el-divider direction="vertical"></el-divider>
                    <a href="">原创书籍</a><el-divider direction="vertical"></el-divider>
                    <a href="">项目库</a><el-divider direction="vertical"></el-divider>
                    <a href="">技术社区</a><el-divider direction="vertical"></el-divider>
                    <a href="">全国中心</a><el-divider direction="vertical"></el-divider>
                    <a href="">帮助</a><el-divider direction="vertical"></el-divider>
                </span>
            </div>
<!--导航页面开始-->
            <div>
                <el-menu
                        style="width: 1200px;margin: 0 auto"
                        :default-active="1"
                        class="el-menu-demo"
                        mode="horizontal"
                        @select="handleSelect"
                        text-color="#000000"
                        active-text-color="#ee2c2c">
                    <el-menu-item v-for="c in categoryArr" :index="c.id">{{c.name}}</el-menu-item>

                    <div style="float: right;margin-top: 10px">
                        <el-input placeholder="请输入搜索内容">
                            <el-button slot="append" icon="el-icon-search"></el-button>
                        </el-input>
                    </div>
                </el-menu>
            </div>
<!--导航页面结束-->
        </el-header>
        <el-main style="width: 1200px;margin: 0 auto;padding: 0">
            <!--轮播图开始-->
<div>

        <el-carousel style=" height: 300px">
            <el-carousel-item v-for="a in bannerArr">
                <img :src="a.url" width="100%" height="100%" alt="">
            </el-carousel-item>
        </el-carousel>

</div>
            <!--轮播图结束-->

            <!--商品列表开始-->
        </el-main>
        <el-main style="width: 1200px;height: 800px;margin: 0 auto;padding: 0">
            <el-row :gutter="20">
                <el-col style="margin-top: 20px" span="6" v-for="p in productArr">
                    <el-card>
                    <img :src="p.url" width="100%" alt="">
                    <div>
                        <p style="font-size: 5px;height: 10px;margin-top: 0">{{p.title}}</p>
                        <div style="color: #666">
                            <span>{{p.price}}</span>
                            <s style="font-size: 12px">{{p.oldPrice}}</s>
                            <span style="float: right">{{p.saleCount}}</span>
                        </div>
                    </div>
                    </el-card>
                </el-col>

            </el-row>

        </el-main>
    <!--    <el-main style="background-color: gold;width: 1200px;height: 430px;margin: 0 auto;padding: 0">

        </el-main>
        <el-main style="background-color: aqua;width: 1200px;height: 430px;margin: 0 auto;padding: 0">

        </el-main>-->

        <!--商品列表结束-->
        <el-footer>
            <div style="height: 50px;background-color: dimgray;
            text-align: center;color: honeydew;padding: 30px 0">
                <p>2002-2022 黑马时代科技集团有限公司(TARENA INTERNATIONAL,INC.) 版权所有京ICP证8000853号-56 京公网安备 11010802029508号</p>
            </div>
        </el-footer>
    </el-container>
</div>
</body>
<!--引入Axios框架-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
   let v = new Vue({
        el: '#app',
        data: function() {
            return {
                categoryArr:[],
                bannerArr:[],
                productArr:[
                    {title:"软件系统测试流程规范",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b1.jpg"},
                    {title:"Java语言基础",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b2.jpg"},
                    {title:"JavaScript基础编程",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b3.jpg"},
                    {title:"Java核心API",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b4.jpg"},
                    {title:"Ae交互动效",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b5.jpg"},
                    {title:"Python基础",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b6.jpg"},
                    {title:"Windows与网络基础",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b7.jpg"},
                    {title:"HTML和cSS核心",price:"12313",oldPrice:"12313",saleCount:"124134",url:"img/b8.jpg"},
                ]

            }
        },

       methods:{
           handleSelect(key,keyPath){
               console.log(key)
           }
       },
       created:function () {
           axios.get("/select/category").then(function (response) {
               v.categoryArr=response.data;
           })
           axios.get("/select/banner").then(function (response) {
               v.bannerArr=response.data;
           })

       }
    })
</script>
</html>